using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Identity;

namespace Book.Blog.Core.Entities
{
    public class User : IdentityUser<Guid>, IBaseEntity
    {
        public string? Avatar { get; set; }
        public string? Bio { get; set; }
        public DateTime CreatedAt { get; set; }
        public DateTime? UpdatedAt { get; set; }
        public bool IsDeleted { get; set; }
        public string? CreatedBy { get; set; }
        public string? UpdatedBy { get; set; }
        public DateTime? LastLoginTime { get; set; }
        public DateTime CreatedTime => CreatedAt;
        public DateTime? UpdatedTime => UpdatedAt;
        
        public virtual ICollection<Post> Posts { get; set; }
        public virtual ICollection<Comment> Comments { get; set; }
        public virtual ICollection<User> Followers { get; set; }
        public virtual ICollection<User> Following { get; set; }

        public User()
        {
            Id = Guid.NewGuid();
            CreatedAt = DateTime.UtcNow;
            IsDeleted = false;
            Posts = new HashSet<Post>();
            Comments = new HashSet<Comment>();
            Followers = new HashSet<User>();
            Following = new HashSet<User>();
            EmailConfirmed = false;
            PhoneNumberConfirmed = false;
            TwoFactorEnabled = false;
        }
    }
} 